package athabasca.ca.dao;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import athabasca.ca.model.Device;
import athabasca.ca.model.User;

import static org.hamcrest.CoreMatchers.*;

public class V1_DeviceTest_Renan
{
	private User testUser;
	
	@Before
	public void setUp ( )
	{
		// This user is already inserted into the database
		testUser = new User ( ( long ) 1 );
	}
	
	/*
	 * There are a couple of tests that must be performed regarding Device creation:
	 * - insert device with expected data (correct device id and user id already registered)
	 * - insert device with correct device id but inexistent user (user id not registered)
	 * - insert device without id
	 * 
	 * */
	@Test
	public final void testCreate ( )
	{
		long deviceId = 0;
		Device insertDevice = new Device ( deviceId );
		
		try
		{
//			assertThat ( V1_Device.create ( insertDevice, testUser ), is ( true ) );
		}
		catch ( Exception e )
		{
			System.err.println ( e.getMessage ( ) );
			fail ( "Device couldn't be created!" );
			e.printStackTrace();
		}
	}

	@Test
	public final void testSelect ( ) 
	{
		fail("Not yet implemented"); // TODO
	}

	@Test
	public final void testUpdate ( )
	{
		fail("Not yet implemented"); // TODO
	}

	@Test
	public final void testDelete ( )
	{
		fail("Not yet implemented"); // TODO
	}

}
